﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Unity;

namespace DiscoveryLogic.Analytics.Modules.Networks
{
    public class NetworkStatsModule:IModule
    {
        #region props
		public IUnityContainer Container { get; private set; }
		public IRegionManager RegionManager { get; private set; }
		#endregion

		#region ctor
        public NetworkStatsModule(IUnityContainer container, IRegionManager regionManager)
		{
			Container = container;
			RegionManager = regionManager;
		}
		#endregion


		#region Implementation of IModule

		public void Initialize()
		{
            NetworkStats statsView = Container.Resolve<NetworkStats>();
            RegionManager.Regions["NetworkStatsRegion"].Add(statsView);
            RegionManager.Regions["NetworkStatsRegion"].Activate(statsView);
            statsView.SubscribeViewStatsEventHandler(null);
		}
		#endregion
    }
}
